package com.gis.postgis.geojson.collection;

import java.util.List;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.gis.postgis.geojson.annotation.GeoJsonGeometries;
import com.gis.postgis.geojson.annotation.GeoJsonType;
import com.gis.postgis.geojson.deserializer.GeoJsonDeserializer;
import com.gis.postgis.geojson.serializer.FeatureType;
import com.gis.postgis.geojson.serializer.GeoJsonSerializer;
import org.locationtech.jts.geom.Geometry;

/**
 * 〈功能简述〉<br>
 * 〈封装Geometry集合〉
 *
 * @author Mr.QL
 * @ClassName GeometryCollection
 * @Date 2022-03-13 0:13
 * @Version 1.0
 */
@GeoJsonType(type = FeatureType.GEOMETRY_COLLECTION)
@JsonSerialize(using = GeoJsonSerializer.class)
@JsonDeserialize(using = GeoJsonDeserializer.class)
public class GeometryCollection<T extends Geometry> {

    public GeometryCollection() {
    }

    private List<T> list;

    @GeoJsonGeometries
    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public GeometryCollection build(List<T> list){
        this.list = list;
        return this;
    }
}

